I am able to get the agent to work though it gets confused about its environment and responds with things like:
"The files aren't found. Let me check if this is a macOS project and the files might be in a different location. The working directory is on Linux but the paths look like macOS. Let me check what's actually in the current directory."
The agent is able to find the files mounted in the container with a little bit of effort though.
But still the second message I send from Xcode causes a failure every time with that error: *** JSON-RPC global stream failed: The operation couldn’t be completed. (IDEIntelligenceProtocol.JSONRPCElement.Error error 1.)**
I have not investigated the Hermes code myself but I did feed the error log to an LLM (so take this diagnosis for whatever it's worth:
Quote below is from AI:
**"Your log proves Xcode sent a cancel:
14:46:42 Cancelled session b05d...
14:46:43 Prompt on session b05d...
14:46:43 Turn ended: reason=interrupted_by_user
The previous turn had completed at 14:41:35, more than five minutes earlier. ACP defines session/cancel as cancelling an ongoing prompt turn. Since no turn was running, Xcode’s cancellation appears stale, unnecessary, or part of its cleanup behavior.
However, Hermes should safely tolerate that. Its current cancellation handler:
Sets cancel_event.
Calls agent.interrupt().
Does so even when state.is_running is false.
The is_running check only controls whether Hermes saves current_prompt_text; it does not prevent the interrupt.
When the next prompt begins, Hermes clears:
state.cancel_event.clear()
but does not clear the internal agent interrupt state.
That explains why the second turn immediately reports: reason=interrupted_by_user and then throws: acp.exceptions.RequestError: Internal error
Responsibility
Xcode is the trigger: it sent a cancellation when Hermes apparently had no active prompt.
Hermes is responsible for the failure: an idle or stale cancellation should not poison the next prompt or terminate the JSON-RPC request with an internal error.
Xcode’s displayed error is only the consequence: its ACP peer returned an unhandled internal error, so Xcode reported the generic “JSON-RPC global stream failed.”
I would report this primarily as a Hermes ACP bug, while explicitly noting that Xcode sends an idle session/cancel immediately before the next session/prompt. A robust fix is for Hermes to ignore cancellation when state.is_running is false and clear any stale internal interrupt state at the beginning of a new prompt.
"**
Figured I'd share. Would be cool to have a working local AI set up in Xcode. So close.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: